<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.shsh.safemanage.util.Util"%>
<%@page import="com.shsh.safemanage.dao.UserDao"%>
<%@page import="com.shsh.safemanage.dao.EquipmentDao"%>
<%@page import="com.shsh.safemanage.model.Equipment"%>
<%@page import="com.shsh.safemanage.model.Department1"%>
<%@page import="com.shsh.safemanage.dao.DepartmentDao"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="com.shsh.safemanage.model.User"%>
<%@page import="com.shsh.safemanage.model.Problem"%>
<%@page import="java.util.List"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.dao.ProblemDao"%>

<%
{
ProblemDao theRelateProblemDao = DaoCreator.createProblemDao();
DepartmentDao theRelateDepartDao = DaoCreator.createDepartmentDao();
EquipmentDao theEquipDao = DaoCreator.createEquipmentDao();
UserDao theRelateUserDao = DaoCreator.createUserDao();

String dateStart = request.getParameter(Constants.REQUEST_PARAMETER_DATE_START);
String dateEnd = request.getParameter(Constants.REQUEST_PARAMETER_DATE_END);
String transferedUserIDStr = request.getParameter(Constants.REQUEST_PARAMETER_USER_ID);
String transferedUserName = request.getParameter(Constants.REQUEST_PARAMETER_NAME);

Long transferedUserID = 0L;
try {
	transferedUserID = new Long(transferedUserIDStr);
} catch (Exception e) {
}

List<Problem> problemList = theRelateProblemDao.getUserWriteProblemList(transferedUserID, dateStart, dateEnd);
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="font-size:12px;">
	<tr>
		<td width="8"  class="appbg">&nbsp;</td>
		<td width="85" class="appbg"><img src="images/trace.gif"  style="vertical-align:middle;"/>查询结果</td>
		<td width="229" class="appbg">&nbsp;</td>
		<td width="58" class="appbg">&nbsp;</td>
		<td width="84" class="appbg">&nbsp;</td>
		<td width="74" class="appbg">&nbsp;</td>
		<td colspan="2" class="appbg">&nbsp;</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td colspan="7" height="30">经办任务（包括填报），共<font color="#FF0000"><%=problemList.size()%></font>条记录。</td>
	</tr>
	<tr>
		<td colspan="8">
		<div style="height: 420; width: 900; overflow-y: auto; overflow-x: hidden">
		<table width="99%" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td class="a_text2" width="17%">发现人单位</td>
				<td class="a_text2" width="16%">装置</td>
				<td width="6%" class="a_text2" align="center">发现人</td>
				<td width="17%" class="a_text2">问题标题</td>
				<td width="20%" class="a_text2">问题内容</td>
				<td width="12%" class="a_text2" align="center">填报日期</td>
				<td width="12%" class="a_text2" align="center">回复日期</td>
			</tr>
			<%
			int row = 0;
			for (Problem problem : problemList) {
				row++;
			%>
			<tr>
				<td style="border-bottom:1px #E3E3E3 dashed;border-right:1px #E3E3E3 dashed; <%=(row % 2 == 1)? "background: #F8F8FF":"background: #DCDCDC"%>"
					class="a_text3" width="17%"><%=problem.getWriterDepartment1Name()%>-<%=problem.getWriterDepartment2Name()%>-<%=problem.getWriterDepartment3Name()%></td>
				<td style="border-bottom:1px #E3E3E3 dashed;border-right:1px #E3E3E3 dashed; <%=(row % 2 == 1)? "background: #F8F8FF":"background: #DCDCDC"%>"
					class="a_text3" width="16%"><%=problem.getEquipmentName()%></td>
				<td style="border-bottom:1px #E3E3E3 dashed;border-right:1px #E3E3E3 dashed; <%=(row % 2 == 1)? "background: #F8F8FF":"background: #DCDCDC"%>" 
					width="6%" class="a_text3" align="center"><%=problem.getWriteUserName()%></td>
				<td style="border-bottom:1px #E3E3E3 dashed;border-right:1px #E3E3E3 dashed; <%=(row % 2 == 1)? "background: #F8F8FF":"background: #DCDCDC"%>" 
					width="17%" class="a_text3"><%=problem.getProblemTitle()%></td>
				<td style="border-bottom:1px #E3E3E3 dashed;border-right:1px #E3E3E3 dashed; <%=(row % 2 == 1)? "background: #F8F8FF":"background: #DCDCDC"%>"
					width="20%" class="a_text3"><%=problem.getProblemContent(50)%></td>
				<td style="border-bottom:1px #E3E3E3 dashed;border-right:1px #E3E3E3 dashed; <%=(row % 2 == 1)? "background: #F8F8FF":"background: #DCDCDC"%>"
					width="12%" class="a_text3" align="center"><%=Util.formatDateTime(problem.getWriteTime())%></td>
				<td style="border-bottom:1px #E3E3E3 dashed;border-right:1px #E3E3E3 dashed; <%=(row % 2 == 1)? "background: #F8F8FF":"background: #DCDCDC"%>"
					width="12%" class="a_text3" align="center"><%=Util.formatDateTime(problem.getCloseTime())%></td>
			</tr>
			<%
			}
			%>
		</table>
		</div>
		</td>
	</tr>
</table>
<%
}
%>